import { http } from '@/utils/http'
import type { OrderListParams, OrderListResult } from '@/types/order'
import type { OrderListDto } from '@/types/orderList'
import type { orderDetailsDto } from '@/types/orderDetails'
import type { MyPage } from '@/types/global'
import type { CareHistory } from '@/types/docter/careHistory'


/**
 * 获取订单列表
 * @param data orderState 订单状态
 */
export const getMemberOrderAPI = (data: OrderListParams) => {
  return http<MyPage>({
    method: 'POST',
    url: `/charge/orderAll/queryAllOrder`,
    data,
  })
}

/**
 * 查询患者病例信息
 */
export const getCareHistoryListByStatusData = (data: OrderListParams) => {
  return http<CareHistory[]>({
    method: 'GET',
    url: `/docter/api/careHistory/getCareHistoryListByStatus`,
    data,
  })
}

/**
 * 获取挂号列表
 * @param data orderState 订单状态
 */
export const getRegistrationListByStatusAPI = (data: OrderListParams) => {
  return http<MyPage>({
    method: 'POST',
    url: `/doctor/registration/getRegistrationListByStatus`,
    data,
  })
}
/**
 * 获取订单详情
 * @param chId orderState 病例id
 */
export const getMemberOrderDetails = (chId: string) => {
  return http<orderDetailsDto>({
    method: 'GET',
    url: `/charge/orderDetails/${chId}`,
  })
}
